﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrewXML.Core.Data;
using BrewXML.Core.Services.NavigationServices;
using Cirrious.CrossCore;
using Cirrious.MvvmCross.ViewModels;

namespace BrewXML.Core.ViewModels
{
    public class HopDetailPageViewModel : BaseViewModel
    {
        #region Properties

        #region HOP

        private HOP mHop;
        public HOP Hop
        {
            get
            {
                return mHop;
            }
            set
            {
                mHop = value;
                RaisePropertyChanged("Hop");
            }
        }
        #endregion

        #region ListType

        public List<string> ListType { get; set; }
        
        #endregion

        #region AllowAdd

        private bool mAllowAdd=false;
        public bool AllowAdd
        {
            get
            {
                return mAllowAdd;
            }
            set
            {
                mAllowAdd = value;
                RaisePropertyChanged("AllowAdd");
            }
        }
        #endregion

        #region EnableAppbar

        private bool mEnableAppbar = true;
        public bool EnableAppbar
        {
            get
            {
                return mEnableAppbar;
            }
            set
            {
                mEnableAppbar = value;
                RaisePropertyChanged("EnableAppbar");
            }
        }
        #endregion

        #endregion

        #region Command

        #region Navigate
        private MvxCommand<string> mNavigateCommand;

        public MvxCommand<string> NavigateCommand
        {
            get
            {
                return new MvxCommand<string>(NavigatePage);
            }
        }

        private void NavigatePage(string parameter)
        {
            switch (parameter)
            {
                case "ManagerDataPage":
                    Mvx.Resolve<INavigationService>().NavigateTo(PageNames.ManagerDataPage); break;
                case "HopsPage":
                    Mvx.Resolve<INavigationService>().NavigateTo(PageNames.HopsPage); break;
                case "GrainsPage":
                    Mvx.Resolve<INavigationService>().NavigateTo(PageNames.GrainsPage); break;
                case "MiscsPage":
                    Mvx.Resolve<INavigationService>().NavigateTo(PageNames.MiscsPage); break;
                case "StylesPage":
                    Mvx.Resolve<INavigationService>().NavigateTo(PageNames.StylesPage); break;
            }

        }
        #endregion
        #endregion

        #region Constructors

        public HopDetailPageViewModel()
        {
            ListType = new List<string>() { "Pellet", "Plug", "Whole" };
        }
        #endregion
    }
}
